home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-08-31 | 9.9 KB | 377 lines | [TEXT/CCL ] |
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; Copyright 1987, 1988, 1989, 1990 by Ruben Kleiman for Apple Computer, Inc.
- ;;; Advanced Technology Group
- ;;;
-
- ;;;
- ;;; Record definitions for AppleTalk protocols
- ;;;
-
- ;;; -------------------------------------------------------------------------------------------
- ;;; ADSP Record Definitions
-
-
-
- ; client control codes
-
- (defconstant $dspInit 255) ; create a new connection end
- (defconstant $dspRemove 254) ; remove a connection end
- (defconstant $dspOpen 253) ; open a connection
- (defconstant $dspClose 252) ; close a connection
- (defconstant $dspCLInit 251) ; create a connection listener
- (defconstant $dspCLRemove 250) ; remove a connection listener
- (defconstant $dspCLListen 249) ; post a listener rest
- (defconstant $dspCLDeny 248) ; deny an open connection rest
- (defconstant $dspStatus 247) ; get status of connection end
- (defconstant $dspRead 246) ; read data from the connection
- (defconstant $dspWrite 245) ; write data on the connection
- (defconstant $dspAttention 244) ; send an attention message
- (defconstant $dspOptions 243) ; set connection end options
- (defconstant $dspReset 242) ; forward reset the connection
- (defconstant $dspNewCID 241) ; generate a cid for a connection end
-
-
-
-
- ; open connection modes
-
- (defconstant $ocRequest 1) ; rest a connection with remote
- (defconstant $ocPassive 2) ; wait for a connection rest from remote
- (defconstant $ocAccept 3) ; accept rest as delivered by listener
- (defconstant $ocEstablish 4) ; consider connection to be open
-
-
-
-
- ; connection states
-
- (defconstant $sListening 1) ; for connection listeners
- (defconstant $sPassive 2) ; waiting for a connection rest from remote
- (defconstant $sOpening 3) ; resting a connection with remote
- (defconstant $sOpen 4) ; connection is open
- (defconstant $sClosing 5) ; connection is being torn down
- (defconstant $sClosed 6) ; connection end state is closed
-
-
-
-
- ; client event flags (bit-mask)
-
- (defconstant $eClosed #x80) ; received connection closed advice
- (defconstant $eTearDown #x40) ; closed due to broken connection
- (defconstant $eAttention #x20) ; received attention message
- (defconstant $eFwdReset #x10) ; received forward reset advice
-
-
- ; miscellaneous ates
-
- (defconstant $attnBufSize 570) ; size of client attention message
- (defconstant $dspPBSize 68) ; byte size of largest dsp param block
- (defconstant $StdQSize 100000) ; standard send or receive queue size
-
- ;;; connection control block
- (defrecord TRCCB
- (ccbLink :pointer) ; link to next ccb
- (refNum :INTEGER) ; user reference number
- (state :INTEGER) ; state of the connection end
- (userFlags :Byte) ; flags for unsolicited connection events
- (localSocket :Byte) ; socket number of this connection end
- (remoteAddress :longint) ; internet address of remote end (AddrBlock)
- (attnCode :INTEGER) ; attention code received
- (attnSize :INTEGER) ; size of received attention data
- (attnPtr :pointer) ; ptr to received attention data
- (r1 :byte)
- (r1 :byte) ; there SHOULD be a better way of doing this!!!
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte)
- (r1 :byte))
-
-
- ;;; driver control call parameter block
-
- (defconstant $remoteAddress 38)
-
- (defrecord DSPParamBlock
- (qLink :pointer) ; QElemPtr
- (qTypeK :INTEGER)
- (ioTrap :INTEGER)
- (ioCmdAddr :pointer)
- (ioCompletion :pointer 0) ; ProcPtr
- (ioResult :INTEGER) ; OSErr
- (ioNamePtr :pointer) ; StringPtr
- (ioVRefNum :INTEGER)
- (ioCRefNum :INTEGER) ; adsp driver refNum
- (csCode :INTEGER) ; adsp driver control code
- (qStatus :LONGINT) ; adsp internal use
- (ccbRefNum :INTEGER) ; refnum of ccb
- (variant ( ; ---- dspInit, dspCLInit: ----
- (ccbPtr :pointer) ; pointer to connection control block (TPCCB)
- (userRoutine :pointer) ; client routine to call on event (ProcPtr)
- (sendQSize :INTEGER) ; size of send queue (0..64K bytes)
- (sendQueue :pointer) ; client passed send queue buffer
- (recvQSize :INTEGER) ; size of receive queue (0..64K bytes)
- (recvQueue :pointer) ; client passed receive queue buffer
- (attnPtr :pointer) ; client passed receive attention buffer
- (localSocket :Byte) ; local socket number
- (filler1 :Byte)) ; filler for proper byte alignment
- ( ; ---- dspOpen, dspCLListen, dspCLDeny: ----
- (localCID :INTEGER) ; local connection id
- (remoteCID :INTEGER) ; remote connection id
- (remoteAddress :longint) ; address of remote end (AddrBlock)
- (filterAddress :longint) ; address filter (AddrBlock)
- (sendSeq :LONGINT) ; local send sequence number
- (sendWindow :INTEGER) ; send window size
- (recvSeq :LONGINT) ; receive sequence number
- (attnSendSeq :LONGINT) ; attention send sequence number
- (attnRecvSeq :LONGINT) ; attention receive sequence number
- (ocMode :Byte) ; open connection mode
- (ocInterval :Byte) ; open connection request retry interval
- (ocMaximum :Byte) ; open connection request retry maximum
- (filler2 :Byte)) ; filler for proper byte alignment
- ( ; ---- dspClose, dspRemove: ----
- (abort :Byte) ; abort connection immediately if non-zero
- (filler3 :Byte)) ; filler for proper byte alignment
- ( ; ---- dspStatus: ----
- (statusCCB :pointer) ; pointer to ccb (TPCCB)
- (sendQPending :INTEGER) ; pending bytes in send queue
- (sendQFree :INTEGER) ; available buffer space in send queue
- (recvQPending :INTEGER) ; pending bytes in receive queue
- (recvQFree :INTEGER)) ; available buffer space in receive queue
- ( ; ---- dspRead, dspWrite: ----
- (reqCount :INTEGER) ; requested number of bytes
- (actCount :INTEGER) ; actual number of bytes
- (dataPtr :pointer) ; pointer to data buffer
- (eom :Byte) ; indicates logical end of message
- (flush :Byte)) ; send data now
- ( ; ---- dspAttention: ----
- (attnCode :INTEGER) ; client attention code
- (attnSize :INTEGER) ; size of attention data
- (attnData :pointer) ; pointer to attention data
- (attnInterval :Byte) ; retransmit timer in 10-tick intervals
- (filler4 :Byte)) ; filler for proper byte alignment
- ( ; ---- dspOptions: ----
- (sendBlocking :INTEGER) ; quantum for data packets
- (sendTimer :Byte) ; send timer in 10-tick intervals
- (rtmtTimer :Byte) ; retransmit timer in 10-tick intervals
- (badSeqMax :Byte) ; threshold for sending retransmit advice
- (useCheckSum :Byte)) ; use ddp packet checksum
- ( ; ---- dspNewCID: ----
- (newCID :INTEGER)))) ; new connection id returned
-
-
- (provide :network-defs)